const DateUtil = {
    format : function(Date) {
        var Y = Date.getFullYear();
        var M = Date.getMonth() + 1;
            M = M < 10 ? '0' + M : M;// 不够两位补充0
        var D = Date.getDate();
            D = D < 10 ? '0' + D : D;
        var H = Date.getHours();
            H = H < 10 ? '0' + H : H;
        var Mi = Date.getMinutes();
            Mi = Mi < 10 ? '0' + Mi : Mi;
        var S = Date.getSeconds();
            S = S < 10 ? '0' + S : S;
            return Y + '-' + M + '-' + D + ' ' + H + ':' + Mi + ':' + S;
    },
    formatTimestamp : function(timestamp) {
        return this.format(new Date(timestamp))
    }
}

export default DateUtil